<!-- TableView15.vue -->
<template>
  <div>
    <h2>添加导出数据功能</h2>
    <Table
        :data="exportData"
        :columns="exportColumns"
        :show-export="true"
        export-mode="all"
        export-type="csv"
        export-file-name="用户数据"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import Table from '@/components/Table/Table.vue'

const exportData = ref([
  { id: 1, name: '张三', age: 28, department: '技术部' },
  { id: 2, name: '李四', age: 32, department: '市场部' },
  // 更多数据...
])

const exportColumns = [
  { title: 'ID', dataIndex: 'id' },
  { title: '姓名', dataIndex: 'name' },
  { title: '年龄', dataIndex: 'age' },
  { title: '部门', dataIndex: 'department' }
]
</script>